import { Component, OnInit } from '@angular/core';
import { SunshineNgZorroAntdModule } from '../../ng-zorro-module';
import { MyDerirective01Directive } from '../../study/directives/my-derirective01.directive';
import { SunshinePermissionDirective } from '../../study/directives/sunshine-permission.directive';
import { FormBuilder, FormGroup } from '@angular/forms';
import { RoleService } from './role.service';

@Component({
  selector: 'app-role',
  standalone: true,
  imports: [SunshineNgZorroAntdModule, MyDerirective01Directive, SunshinePermissionDirective],
  templateUrl: './role.component.html',
  styleUrl: './role.component.css'
})
export class RoleComponent implements OnInit {
  search() {
    console.log('ser..............');
    this.roleService.getRoles(this.pageIndex, this.pageSize, null, null, []).subscribe(data => {
      console.log(data)
    });
  }
  validateForm: FormGroup = this.fb.group({
    roleName: 'zhangsan',
  });

  total = 1;
  loading = true;
  pageSize = 10;
  pageIndex = 1;

  constructor(private fb: FormBuilder, private roleService: RoleService) { }

  ngOnInit(): void {
    //Called after the constructor, initializing input properties, and the first call to ngOnChanges.
    //Add 'implements OnInit' to the class.
    this.roleService.getRoles(this.pageIndex, this.pageSize, null, null, []);
  }
}
